package com.bestplus.daqingapp;

import com.facebook.react.ReactActivity;
import com.oblador.vectoricons.VectorIconsPackage;
import com.reactnativerecordsound.ReactNativeRecordSoundPackager;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import java.util.Arrays;
import java.util.List;
import android.os.Bundle;
import com.cboy.rn.splashscreen.SplashScreen;
import java.util.Timer;
import java.util.TimerTask;
import com.brentvatne.react.ReactVideoPackage;
 import android.content.Intent; // <--- import
    import android.content.res.Configuration; // <--- import
import com.pgyersdk.crash.PgyCrashManager;
public class MainActivity extends ReactActivity {

    /**
     * Returns the name of the main component registered from JavaScript.
     * This is used to schedule rendering of the component.
     */
    @Override
    protected String getMainComponentName() {
        return "AppClient";
    }

    @Override                                                   // HERE
    protected void onCreate(Bundle savedInstanceState) {        // HERE
        SplashScreen.show(this, true);                          // HERE
        super.onCreate(savedInstanceState);                     // HERE

        Timer timer=new Timer();//实例化Timer类
        timer.schedule(new TimerTask(){
           public void run(){
              SplashScreen.hide(MainActivity.this);
              this.cancel();
            }
        },3000);//3秒启动页时间
    }

    @Override
    public void onConfigurationChanged(Configuration newConfig) {
        super.onConfigurationChanged(newConfig);
        Intent intent = new Intent("onConfigurationChanged");
        intent.putExtra("newConfig", newConfig);
        PgyCrashManager.register(this);
        this.sendBroadcast(intent);
    }
}
